﻿@model StoreThemeSelectorModel
@inject IWebHelper webHelper
@if (Model.AvailableStoreThemes.Count > 1)
{
    var themes = Model.AvailableStoreThemes.Select(x => new SelectListItem
    {
        Text = x.Title,
        Value = Url.Action("SetStoreTheme", "Common", new { themename = x.Name, returnUrl = webHelper.GetRawUrl(Context.Request)}),
        Selected = x.Name.Equals(Model.CurrentStoreTheme.Name, StringComparison.OrdinalIgnoreCase)
    });
    <b-col md="4" cols="12" class="theme-selector">
        @Html.DropDownList("store-theme", themes, new {@class="custom-select form-control", onchange = "location = (this.value);" })
    </b-col>
}